package com.qiyun.framework.utils;

import android.content.Context;
import android.widget.Toast;

/**
 * 提示公用类
 */
public class ToastUtils {
        private static Toast mToast;

        public ToastUtils() {
        }

        public static void show(Context context, int resId) {
            if(mToast != null) {
                mToast.cancel();
                mToast = null;
            }

            if(context != null) {
                mToast = Toast.makeText(context, resId, 0);
                mToast.show();
            }

        }

        public static void show(Context context, CharSequence text) {
            if (mToast != null) {
                mToast.cancel();
                mToast = null;
            }

            if (context != null) {
                mToast = Toast.makeText(context, text, 0);
                mToast.show();
            }

        }
}
